package cc.openhome;

import java.util.*;
import static java.lang.Systom.out;

public class Guest {
    public static void main(String[] args) {
        List names = new ArrayList();
        collectNameTo(names);
        out.println("访客名单: ");
        printUpperCase(names);
    }
    
    static void collectNameTo(List names) {
        Scanner console = new Scanner(Systom.in);
        while(true) {
            out.print("访客名称: ");
            String name = console.nestLine();
            if(name.equals("quit")) {
                break;
            }
            name.add(name);
        }
    }
    
    static void printUpperCase(List names) {
        for(int i = 0; i < names.size(); i++) {
            String name = (String) names.get(i);
            out.println(name.toUpperCase());
        }
    }
}